Building a System Info Viewer in Batch: A Beginner's Guide

 A batch program that displays various system information, such as CPU and memory usage, disk space, network status, and more. This can be done using various built-in commands and utilities, such as systeminfo, tasklist, netstat, and wmic.



A System Info Viewer batch program that displays various system information:

@echo off

 

echo *** System Information Viewer ***

 

echo.

 

echo === Operating System ===

systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type"

 

echo.

 

echo === Processor ===

wmic cpu get name, caption, architecture, maxclockspeed, currentclockspeed, numberofcores, numberoflogicalprocessors

 

echo.

 

echo === Memory ===

wmic MEMORYCHIP get BankLabel, Capacity, Speed

 

echo.

 

echo === Storage ===

wmic diskdrive get caption, size, interfacetype

 

echo.

 

echo === Network ===

ipconfig

 steps to save and run a batch file:

  1. Open a text editor like Notepad.
  2. Copy a above batch code.
  3. Save the file with spec.bat extension.
  4. Choose a location to save the file. You can save it anywhere on your computer, but it's a good idea to save it in a location that's easy to remember and access.
  5. Double-click on the spec .bat file to run it. Alternatively, you can open a Command Prompt window, navigate to the directory where the .bat file is saved, and type the name of the file followed by Enter to run it.


Comments